package com.example.leetcode.niuke;

import java.util.Scanner;

public class NiuKe9 {


    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int count = Integer.parseInt(scanner.nextLine());
        String s = scanner.nextLine();
        String[] split = s.split(" ");
        int[] ints = new int[count];
        for (int i = 0;i<count-1;i++) {
            boolean add =false;
            for (int j = i+ 1;j< count;j++) {
                if (Integer.parseInt(split[j]) > Integer.parseInt(split[i])) {
                    ints[i] = (Integer.parseInt(split[j]) - Integer.parseInt(split[i])) * (j - i);
                    add = true;
                    break;
                }
            }
            if (!add) {
                ints[i] = Integer.parseInt(split[i]);
            }
        }
        ints[count -1] = Integer.parseInt(split[count -1]);
        for (int i = 0; i<count;i++) {
            System.out.print(ints[i]);
            if (i != count -1) {
                System.out.print(" ");
            }
        }
    }
}
